package com.itheima.job3;

import java.util.*;
import java.util.stream.Collectors;

public class Test {
    public static void main(String[] args) {
        List<String> names = new ArrayList<>();
        Collections.addAll(names,"刘备字玄德" ,"诸葛亮字孔明", "曹操字孟德","孙权字仲谋", "关羽字云长"," 张飞字翼德","赵云字子龙", "乐进字文谦", "李典字曼成", "曹仁字子孝", "曹洪字子廉");
        Map<String, String> map = names.stream()
                .collect(Collectors.toMap(s -> s.split("字")[0], s -> s.split("字")[1]));
        map.forEach((key,value)-> System.out.println(key+" "+value));

    }
}
